﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HA.ModFlow.Application
{
    /// <summary>
    /// RibbonView.xaml 的交互逻辑
    /// </summary>
    public partial class RibbonView : UserControl
    {
        public RibbonView()
        {
            InitializeComponent();
            
        }

        //RibbonViewModel _viewModel;

        //public RibbonViewModel ViewModel
        //{
        //    get { return _viewModel; }
        //    set {
                
        //        _viewModel = value;

        //        this.DataContext = this._viewModel;

        //        this.miniGrid.ViewModel = this._viewModel.MinGridVM;

            
        //    }
        //}


        RibbonViewModelV2 _viewModel;

        public RibbonViewModelV2 ViewModel
        {
            get { return _viewModel; }
            set { 
                
                _viewModel = value;

                this.DataContext = this._viewModel;

                //   this.miniGrid.ViewModel = this._viewModel.MinGridVM;

            
            
            }
        }



        //  <Grid.Resources>
        //    <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
        //    <!-- RibbonTab -->
        //    <Style TargetType="{x:Type ribbon:RibbonTab}">
        //        <Setter Property="ContextualTabGroupHeader" Value="{Binding ContextualTabGroupHeader}" />
        //        <Setter Property="Header" Value="{Binding Header}" />
        //        <Setter Property="ItemsSource" Value="{Binding GroupDataCollection}" />
        //    </Style>
        //    <!-- RibbonContextualTabGroup -->
        //    <Style TargetType="{x:Type ribbon:RibbonContextualTabGroup}">
        //        <Setter Property="Header" Value="{Binding Header}" />
        //        <Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource BoolToVisibilityConverter}}" />
        //    </Style>
        //    <!-- RibbonControl -->
        //    <Style x:Key="RibbonControlStyle">
        //        <Setter Property="ribbon:RibbonControlService.Label" Value="{Binding Label}" />
        //        <Setter Property="ribbon:RibbonControlService.LargeImageSource" Value="{Binding LargeImage}" />
        //        <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{Binding SmallImage}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipTitle" Value="{Binding ToolTipTitle}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipDescription" Value="{Binding ToolTipDescription}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{Binding ToolTipImage}" />
        //    </Style>
        //    <!-- RibbonGroup -->
        //    <Style TargetType="{x:Type ribbon:RibbonGroup}" BasedOn="{StaticResource RibbonControlStyle}">
        //        <Setter Property="QuickAccessToolBarId" Value="{Binding Label}" />
        //        <Setter Property="Header" Value="{Binding Label}" />
        //        <Setter Property="ItemsSource" Value="{Binding ControlDataCollection}" />
        //    </Style>
        //    <!-- RibbonButton -->
        //    <DataTemplate DataType="{x:Type data:ButtonData}">
        //        <ribbon:RibbonButton />
        //    </DataTemplate>
        //    <Style TargetType="{x:Type ribbon:RibbonButton}" BasedOn="{StaticResource RibbonControlStyle}">
        //        <Setter Property="Command" Value="{Binding Command}" />
        //    </Style>
        //    <!-- RibbonToggleButton -->
        //    <DataTemplate DataType="{x:Type data:ToggleButtonData}">
        //        <ribbon:RibbonToggleButton />
        //    </DataTemplate>
        //    <Style TargetType="{x:Type ribbon:RibbonToggleButton}" BasedOn="{StaticResource RibbonControlStyle}">
        //        <Setter Property="Command" Value="{Binding Command}" />
        //        <Setter Property="IsChecked" Value="{Binding IsChecked}" />
        //    </Style>
        //    <!-- RibbonRadioButton -->
        //    <DataTemplate DataType="{x:Type data:RadioButtonData}">
        //        <ribbon:RibbonRadioButton />
        //    </DataTemplate>
        //    <Style TargetType="{x:Type ribbon:RibbonRadioButton}" BasedOn="{StaticResource RibbonControlStyle}">
        //        <Setter Property="Command" Value="{Binding Command}" />
        //        <Setter Property="IsChecked" Value="{Binding IsChecked}" />
        //    </Style>
        //    <!-- RibbonCheckBox -->
        //    <DataTemplate DataType="{x:Type data:CheckBoxData}">
        //        <ribbon:RibbonCheckBox />
        //    </DataTemplate>
        //    <Style TargetType="{x:Type ribbon:RibbonCheckBox}" BasedOn="{StaticResource RibbonControlStyle}">
        //        <Setter Property="Command" Value="{Binding Command}" />
        //        <Setter Property="IsChecked" Value="{Binding IsChecked}" />
        //    </Style>
        //    <!-- RibbonTextBox -->
        //    <DataTemplate DataType="{x:Type data:TextBoxData}">
        //        <ribbon:RibbonTextBox />
        //    </DataTemplate>
        //    <Style TargetType="{x:Type ribbon:RibbonTextBox}" BasedOn="{StaticResource RibbonControlStyle}">
        //        <Setter Property="Command" Value="{Binding Command}" />
        //        <Setter Property="Text" Value="{Binding Text}" />
        //    </Style>
        //    <!-- RibbonMenuButton -->
        //    <DataTemplate DataType="{x:Type data:MenuButtonData}">
        //        <ribbon:RibbonMenuButton />
        //    </DataTemplate>
        //    <Style TargetType="{x:Type ribbon:RibbonMenuButton}" BasedOn="{StaticResource RibbonControlStyle}">
        //        <Setter Property="ItemsSource" Value="{Binding ControlDataCollection}" />
        //        <Setter Property="QuickAccessToolBarId" Value="{Binding Command}" />
        //        <Setter Property="CanUserResizeHorizontally" Value="True" />
        //        <Setter Property="CanUserResizeVertically" Value="True" />
        //        <Setter Property="UsesItemContainerTemplate" Value="True" />
        //        <Setter Property="DropDownHeight" Value="200" />
        //    </Style>
        //    <!-- RibbonSplitButton -->
        //    <DataTemplate DataType="{x:Type data:SplitButtonData}">
        //        <ribbon:RibbonSplitButton />
        //    </DataTemplate>
        //    <Style TargetType="{x:Type ribbon:RibbonSplitButton}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuButton}}">
        //        <Setter Property="IsCheckable" Value="{Binding IsCheckable}" />
        //        <Setter Property="IsChecked" Value="{Binding IsChecked}" />
        //        <Setter Property="Command" Value="{Binding Command}" />
        //        <Setter Property="HeaderQuickAccessToolBarId" Value="{Binding Label}" />
        //        <Setter Property="CanUserResizeHorizontally" Value="True" />
        //        <Setter Property="CanUserResizeVertically" Value="True" />
        //        <Setter Property="UsesItemContainerTemplate" Value="True" />
        //        <Setter Property="DropDownHeight" Value="200" />
        //    </Style>
        //    <!-- RibbonComboBox -->
        //    <DataTemplate DataType="{x:Type data:ComboBoxData}">
        //        <ribbon:RibbonComboBox
        //            IsEditable="True"
        //            TextSearch.TextPath="Label"/>
        //    </DataTemplate>
        //    <Style TargetType="{x:Type ribbon:RibbonComboBox}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuButton}}">
        //        <Setter Property="IsEditable" Value="True" />
        //        <Setter Property="TextSearch.TextPath" Value="Label" />
        //    </Style>
        //    <!-- RibbonGallery -->

        //    <ItemContainerTemplate x:Key="{ItemContainerTemplateKey DataType={x:Type data:GalleryData}}">






        //        <ribbon:RibbonGallery />

        //    </ItemContainerTemplate>



        //    <Style TargetType="{x:Type ribbon:RibbonGallery}">
        //        <Style.Resources>
        //            <!-- Note that this Style has been specified only to trump the 
        //                 implicit style for RibbonMenuItem from being picked by the 
        //                 items within the FilterMenuButton -->
        //            <Style TargetType="{x:Type ribbon:RibbonMenuItem}" />
        //            <DataTemplate x:Key="FilterItemTemplate">
        //                <TextBlock Text="{Binding Label}" />
        //            </DataTemplate>
        //        </Style.Resources>
        //        <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{Binding SmallImage}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipTitle" Value="{Binding ToolTipTitle}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipDescription" Value="{Binding ToolTipDescription}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{Binding ToolTipImage}" />
        //        <Setter Property="ItemsSource" Value="{Binding CategoryDataCollection}" />
        //        <Setter Property="Command" Value="{Binding Command}" />
        //        <Setter Property="SelectedItem" Value="{Binding SelectedItem}" />
        //        <Setter Property="MinColumnCount" Value="3" />
        //        <Setter Property="CanUserFilter" Value="True" />
        //        <Setter Property="FilterItemTemplate" Value="{StaticResource FilterItemTemplate}" />
        //    </Style>
        //    <!-- RibbonGalleryCategory -->
        //    <Style TargetType="{x:Type ribbon:RibbonGalleryCategory}">
        //        <Setter Property="Header" Value="{Binding Label}" />
        //        <Setter Property="ItemsSource" Value="{Binding GalleryItemDataCollection}" />
        //    </Style>
        //    <!-- RibbonGalleryItem -->
        //    <DataTemplate DataType="{x:Type data:GalleryItemData}">
        //        <Grid>
        //            <Grid.RowDefinitions>
        //                <RowDefinition />
        //                <RowDefinition />
        //            </Grid.RowDefinitions>
        //            <Image Source="{Binding LargeImage}" Height="32" Width="32" />
        //            <TextBlock Grid.Row="1" Text="{Binding Label}" />
        //        </Grid>
        //    </DataTemplate>
        //    <!-- RibbonMenuItem -->

        //    <ItemContainerTemplate x:Key="{ItemContainerTemplateKey DataType={x:Type data:MenuItemData}}">






        //        <ribbon:RibbonMenuItem />

        //    </ItemContainerTemplate>



        //    <Style TargetType="{x:Type ribbon:RibbonMenuItem}">
        //        <Setter Property="ImageSource" Value="{Binding SmallImage}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipTitle" Value="{Binding ToolTipTitle}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipDescription" Value="{Binding ToolTipDescription}" />
        //        <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{Binding ToolTipImage}" />
        //        <Setter Property="Command" Value="{Binding Command}" />
        //        <Setter Property="CanUserResizeHorizontally" Value="True" />
        //        <Setter Property="CanUserResizeVertically" Value="True" />
        //        <Setter Property="UsesItemContainerTemplate" Value="True" />
        //        <Setter Property="DropDownHeight" Value="200" />
        //        <Setter Property="ItemsSource" Value="{Binding ControlDataCollection}" />
        //        <Setter Property="IsCheckable" Value="{Binding IsCheckable}" />
        //        <Setter Property="IsChecked" Value="{Binding IsChecked}" />
        //        <!-- Note that setting Header property is not sufficient in this case 
        //             because the HeaderTemplate is implicitly resolved to type MenuItemData 
        //             which is the item for this container. Hence we explicitly specify the 
        //             HeaderTemplate to avoid the implicit DataTemplate resolution from kicking in. -->
        //        <Setter Property="HeaderTemplate">
        //            <Setter.Value>
        //                <DataTemplate>
        //                    <TextBlock Text="{Binding Label}" />
        //                </DataTemplate>
        //            </Setter.Value>
        //        </Setter>
        //    </Style>
        //    <!-- RibbonSplitMenuItem -->

        //    <ItemContainerTemplate x:Key="{ItemContainerTemplateKey DataType={x:Type data:SplitMenuItemData}}">






        //        <ribbon:RibbonSplitMenuItem />

        //    </ItemContainerTemplate>



        //    <Style TargetType="{x:Type ribbon:RibbonSplitMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuItem}}">
        //        <Setter Property="HeaderQuickAccessToolBarId" Value="{Binding Label}" />
        //        <Style.Triggers>
        //            <Trigger Property="HasItems" Value="false">
        //                <Setter Property="HeaderQuickAccessToolBarId" Value="{x:Null}" />
        //            </Trigger>
        //        </Style.Triggers>
        //    </Style>
        //    <!-- RibbonSeparator -->

        //    <ItemContainerTemplate x:Key="{ItemContainerTemplateKey DataType={x:Type data:SeparatorData}}">






        //        <ribbon:RibbonSeparator />

        //    </ItemContainerTemplate>



        //    <!-- RibbonApplicationMenuItem -->

        //    <ItemContainerTemplate x:Key="{ItemContainerTemplateKey DataType={x:Type data:ApplicationMenuItemData}}">






        //        <ribbon:RibbonApplicationMenuItem />

        //    </ItemContainerTemplate>



        //    <Style TargetType="{x:Type ribbon:RibbonApplicationMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuItem}}" />
        //    <!-- RibbonApplicationSplitMenuItem -->

        //    <ItemContainerTemplate x:Key="{ItemContainerTemplateKey DataType={x:Type data:ApplicationSplitMenuItemData}}">






        //        <ribbon:RibbonApplicationSplitMenuItem />

        //    </ItemContainerTemplate>



        //    <Style TargetType="{x:Type ribbon:RibbonApplicationSplitMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonSplitMenuItem}}" />
        //    <!-- RibbonContextMenu -->
        //    <Style TargetType="{x:Type ribbon:RibbonContextMenu}">
        //        <Style.Resources>
        //            <!-- Note that this Style has been specified only to trump the 
        //                 implicit style for RibbonMenuItem from being picked by the 
        //                 items within the ContextMenu -->
        //            <Style TargetType="{x:Type ribbon:RibbonMenuItem}" />
        //        </Style.Resources>
        //    </Style>
        //</Grid.Resources>


    }
}
